<!DOCTYPE html>
<html class="pixel-ratio-1"><head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>茵曼商城</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="stylesheet" href="css/sm.min.css">
    <link rel="stylesheet" href="css/sm-extend.min.css">
    <link rel="stylesheet" href="css/inman.css">
    <script src="https://hm.baidu.com/hm.js?5ee51ef74fa865950bb9a2757fdb33ad"></script><script type="text/javascript" src="js/zepto.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="js/sm.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="js/sm-extend.js" charset="utf-8"></script>
    <script type="text/javascript" src="js/functions.js" charset="utf-8"></script>
    <script type="text/javascript" src="js/TouchSlide.1.1.js" charset="utf-8"></script>
    <script type="text/javascript" src="js/jweixin-1.0.0.js"></script>
    <script>
        var _hmt = _hmt || [];
        (function() {
            var hm = document.createElement("script");
            hm.src = "https://hm.baidu.com/hm.js?5ee51ef74fa865950bb9a2757fdb33ad";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
    </script>
</head>
<body>
<div class="page-group track-list-page">
    <div class="page page-current" id="page-1510724355718">
        <!--标题栏-->
        <header class="bar bar-nav">
            <a class="icon icon-left pull-left" href="javascript:history.back(-1);"></a>
            <h1 class="title">我的足迹</h1>
        </header>

        <!--内容区-->
        <div class="content infinite-scroll infinite-scroll-bottom native-scroll" data-distance="100">
            <div class="track-list">
                <div class="date-box">
                    <p>今天</p>
                </div>

                <div class="item goods-item">
                    <a href="http://m.inman.com.cn/index.php/Goods/goodsdetail?goods_bn=1874132427">
                        <h5>05:36 收藏了</h5>
                    </a><div class="goods-info"><a href="http://m.inman.com.cn/index.php/Goods/goodsdetail?goods_bn=1874132427">
                    <div class="img-box"><img src="http://img.inman.com.cn/uploads/image/20171012/1507788670684961.jpg"></div>
                </a><div class="txt-box"><a href="http://m.inman.com.cn/index.php/Goods/goodsdetail?goods_bn=1874132427">
                    <h3>茵曼2017冬新款文艺黑白条纹半高领针织衫女宽松打底衫</h3>
                    <p>￥<strong>199.00</strong></p>
                </a><a href="http://m.inman.com.cn/index.php/Goods/goodsdetail?goods_bn=1874132427">查看详情</a>
                </div>
                    <div class="cb"></div>
                </div>

                </div>

                <div class="item goods-item">
                    <a href="http://m.inman.com.cn/index.php/Goods/goodsdetail?goods_bn=1874132427">
                        <h5>05:36 浏览了</h5>
                    </a><div class="goods-info"><a href="http://m.inman.com.cn/index.php/Goods/goodsdetail?goods_bn=1874132427">
                    <div class="img-box"><img src="http://img.inman.com.cn/uploads/image/20171012/1507788670684961.jpg"></div>
                </a><div class="txt-box"><a href="http://m.inman.com.cn/index.php/Goods/goodsdetail?goods_bn=1874132427">
                    <h3>茵曼2017冬新款文艺黑白条纹半高领针织衫女宽松打底衫</h3>
                    <p>￥<strong>199.00</strong></p>
                </a><a href="http://m.inman.com.cn/index.php/Goods/goodsdetail?goods_bn=1874132427">查看详情</a>
                </div>
                    <div class="cb"></div>
                </div>

                </div>

                <div class="item goods-item">
                    <a href="http://m.inman.com.cn/index.php/Goods/goodsdetail?goods_bn=1874121020">
                        <h5>03:08 浏览了</h5>
                    </a><div class="goods-info"><a href="http://m.inman.com.cn/index.php/Goods/goodsdetail?goods_bn=1874121020">
                    <div class="img-box"><img src="http://img.inman.com.cn/uploads/image/20171012/1507781253402842.jpg"></div>
                </a><div class="txt-box"><a href="http://m.inman.com.cn/index.php/Goods/goodsdetail?goods_bn=1874121020">
                    <h3>茵曼冬装新款连帽加厚保暖中长款白鸭绒羽绒服女</h3>
                    <p>￥<strong>799.00</strong></p>
                </a><a href="http://m.inman.com.cn/index.php/Goods/goodsdetail?goods_bn=1874121020">查看详情</a>
                </div>
                    <div class="cb"></div>
                </div>

                </div>

                <div class="item goods-item">
                    <a href="http://m.inman.com.cn/index.php/Goods/goodsdetail?goods_bn=1863123224">
                        <h5>03:03 浏览了</h5>
                    </a><div class="goods-info"><a href="http://m.inman.com.cn/index.php/Goods/goodsdetail?goods_bn=1863123224">
                    <div class="img-box"><img src="http://img.inman.com.cn/public/images/c5/6a/47/16cc842cdd3ee022fa597130a8060fa3019773c3.jpg"></div>
                </a><div class="txt-box"><a href="http://m.inman.com.cn/index.php/Goods/goodsdetail?goods_bn=1863123224">
                    <h3>茵曼2016秋装新款多色轻薄保暖连帽羽绒马夹女马甲背心</h3>
                    <p>￥<strong>299.00</strong></p>
                </a><a href="http://m.inman.com.cn/index.php/Goods/goodsdetail?goods_bn=1863123224">查看详情</a>
                </div>
                    <div class="cb"></div>
                </div>

                </div>

                <div class="item goods-item">
                    <a href="http://m.inman.com.cn/index.php/Goods/goodsdetail?goods_bn=4873013029">
                        <h5>02:59 浏览了</h5>
                    </a><div class="goods-info"><a href="http://m.inman.com.cn/index.php/Goods/goodsdetail?goods_bn=4873013029">
                    <div class="img-box"><img src="http://img.inman.com.cn/uploads/image/20170724/1500882578267708.jpg"></div>
                </a><div class="txt-box"><a href="http://m.inman.com.cn/index.php/Goods/goodsdetail?goods_bn=4873013029">
                    <h3>茵曼女鞋布洛克圆头系带小皮鞋女英伦风平底复古单鞋女</h3>
                    <p>￥<strong>369.00</strong></p>
                </a><a href="http://m.inman.com.cn/index.php/Goods/goodsdetail?goods_bn=4873013029">查看详情</a>
                </div>
                    <div class="cb"></div>
                </div>

                </div>

            </div>

            <div class="tip" style="display: block;">
                <p>-- 已加载完所有数据 --</p>
            </div>
        </div>
    </div>

    <script type="text/javascript">
        function getLocalTime(nS) {
            var time = new Date(parseInt(nS) * 1000).getHours();
            time += ':' + new Date(parseInt(nS) * 1000).getMinutes();
            return time;
        }

        // 加载flag
        var loading = false;

        // 注册'infinite'事件处理函数
        $(document).on('infinite', '.infinite-scroll-bottom',function() {

            // 如果正在加载，则退出
            if (loading) return;

            // 设置flag
            loading = true;

            var offset = $('.track-list .item').length;
            var limit = 10;
            var lastDate = $('.date-box').last().children('p').html();
            $.ajax({
                type: 'post',
                data: {'offset':offset,'limit':limit},
                dataType: 'json',
                url: "http://m.inman.com.cn/index.php/User/ajaxTrackList",
                success: function(res){
                    console.log(res);
                    if(res.data.length<=0){
                        //加载完毕，则注销无限加载事件，以防不必要的加载
                        $.detachInfiniteScroll($('.infinite-scroll'));
                        // 删除加载提示符
                        $('.infinite-scroll-preloader').remove();
                        $('.tip').show();
                        return false;
                    }
                    var html = '';
                    for(var i = 0;i<res.data.length;i++){
                        if(i==0){
                            if(res.data[i]['date']!=lastDate){
                                html += '<div class="date-box"> <p>'+res.data[i]['date']+'</p> </div>';
                            }
                        }else{
                            if(res.data[i]['date']!=res.data[i-1]['date']){
                                html += '<div class="date-box"> <p>'+res.data[i]['date']+'</p> </div>';
                            }
                        }

                        if(res.data[i]['type']==5){
                            html += '<div class="item goods-item"><a href="http://m.inman.com.cn/index.php/Goods/goodsdetail?goods_bn='+res.data[i]['redirect_key']+'"><h5>'+getLocalTime(res.data[i]['created_at'])+'&nbsp;'+res.data[i]['actionStr']+'</h5> <div class="goods-info"> <div class="img-box"><img src="'+res.data[i]['image_url']+'"></div> <div class="txt-box"> <h3>'+res.data[i]['title']+'</h3> <p>￥<strong>'+res.data[i]['fav_price']+'</strong></p> <a>查看详情</a> </div><div class="cb"></div></a></div></div>';
                        }else{
                            var link = '';
                            var comment = '';
                            if(res.data[i]['redirect_type']==1){
                                link = '<a class="link" href="http://m.inman.com.cn/index.php/Yinyuehui/articleDetails?article_id='+res.data[i]['redirect_key']+'">';
                            }else{
                                link = '<a class="link" href="http://m.inman.com.cn/index.php/Yinyuehui/showDetails?share_id='+res.data[i]['redirect_key']+'">';
                            }
                            if(res.data[i]['comment']){
                                comment = '<p class="comments">'+res.data[i]['comment']+'</p>';
                            }
                            html += '<div class="item article-item"><h5>'+getLocalTime(res.data[i]['created_at'])+'&nbsp;'+res.data[i]['actionStr']+'</h5><div class="article-info">'+link+'</a><div class="img-box" style="background-image: url('+res.data[i]['image_url']+')"></div> <div class="txt-box"> <h3>'+res.data[i]['title']+'</h3> <p>'+res.data[i]['content']+'</p><a>查看详情</a> </div> <div class="cb"></div> </div>'+comment+' </div>';
                        }
                    }
                    $('.track-list').append(html);
                    $.refreshScroller();
                    if(res.data.length<limit){
                        //加载完毕，则注销无限加载事件，以防不必要的加载
                        $.detachInfiniteScroll($('.infinite-scroll'));
                        // 删除加载提示符
                        $('.infinite-scroll-preloader').remove();
                        $('.tip').show();
                        return false;
                    }
                    loading = false;
                },
                error: function(res){
                    $.toast(res.errmsg);
                }
            });
        });

        $.init();
    </script>
</div>

</body></html>